package day08.thread02.stopThread;

/**
 * <>
 * <interrupt()停止线程>
 *
 * @Author WANG.SONG.
 * @Date 2019/3/3 0003 21:37
 * @see
 */
public class InterruptThread extends Thread{

    @Override
    public void run() {
        super.run();
        for (int i = 0 ; i < 5000000 ; i++){
            if (InterruptThread.interrupted()){
                System.out.println("退出！！！！！");
                break;
            }
            System.out.println("i = "+i);
        }
        System.out.println("线程停止我还是继续执行");
    }
}
